<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
    <script src="../node_modules/vue/dist/vue.js"></script>
  </head>

  <body>
    <div id="app">
      <cpm></cpm>
      <ccc></ccc>
    </div>

    <template id="cpm">
      <div>
        <h2>{{title}}</h2>
        <p>hahahah</p>
        <p>hehehehehe</p>
      </div>
    </template>
    <script>
      Vue.component("cpm", {
        template: "#cpm ",
        data() {
          return {
            title: "你好",
          };
        },
      });

      var vm = new Vue({
        el: "#app",
        data: {},
        methods: {},
        components: {
          ccc: {
            template: "#cpm",
            data() {
              return {
                title: "world",
              };
            },
          },
        },
      });
    </script>
  </body>
</html>
